package com.patrol.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.patrol.pojo.RiskInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface RiskInfoDao extends BaseMapper<RiskInfo> {
//    int deleteByPrimaryKey(Integer id);
//
//    int insert(RiskInfo record);
//
//    int insertSelective(RiskInfo record);
//
//    RiskInfo selectByPrimaryKey(Integer id);
//
//    int updateByPrimaryKeySelective(RiskInfo record);
//
//    int updateByPrimaryKey(RiskInfo record);

    @Insert("insert into risk_info (userId,realName,message,create_time,tag) values(#{userId},#{realName},#{message},#{create_time},#{tag})")
    Integer insertRiskInfo(Integer userId, String realName, String message, String create_time, Integer tag);

    @Update("update risk_info set tag=0 where realName=#{realName}")
    void updateTag(String realName);

    @Select("select count(*) from risk_info where tag=1")
    int findTagCount();
}